<div class="jumbotron">

    <table  class="table table-bordered table-hover">
        <tr >
            <th colspan="5" style="text-align: center;font-size: 24px;" >我的信箱</th>
        </tr>
        <tr>
            <th>内容</th>
            <th>状态</th>
            <th>发送时间</th>
            <th>回复</th>
            <th>操作</th>
        </tr>
            <volist name="messages" id="vo">
                    <tr class="message-id-<{$vo.message_id}> unread info">
                        <td class="mail-ontact">
                            <a href="mail_detail.html" data-toggle="tooltip" data-placement="right" title="点击查看详细内容"><{$vo.message}></a>
                        </td>

                        <td class="">
                            <if condition='$vo.status eq 1'>
                                    <span class="label label-danger">未读</span>
                            <else />
                                 <span class="label label-success">已读</span>
                            </if>
                        </td>
                        <td class="">
                            <i class="glyphicon glyphicon-time"></i>
                            <{$vo.send_time|date="Y年m月d日 H:i",###}>
                        </td>
                        <td class="">
                            <if condition='$vo.status eq 1'>
                                 已回复
                            <else />
                                 未回复
                            </if>
                        </td>
                        <td class=" mail-date">
                            <a data-toggle="tooltip" data-placement="left" title="删除" href="javascript:delMess('<{$vo.message_id}>')"><i class="glyphicon glyphicon-trash"></i></a>
                            <a data-toggle="tooltip" data-placement="right" title="回复" href="<{:U('Member/reMessage',array('message_id'=>$vo['message_id']))}>"><i class="glyphicon glyphicon-edit"></i></a>
                        </td>
                    </tr>
            </volist>

    </table>

</div>
<script>
function delMess(message_id=0){
    if(message_id > 0){
        $.ajax({
         type: "POST",
         url: "<{:U('Member/delMessage')}>",
         data: "message_id="+message_id,
         success: function(msg){
            if(msg == 'success'){
                $('.message-id-'+message_id).remove();
                swal("删除成功","","success");
            }else{
              swal({
                   title:"网络不稳定，失败了！",
                   text:"",
                   type:"error"
               });
            }
         }
      });
    }
}
</script>